/**
 * @param {number} length
 * @returns {number[]}
 */
export function shuffle(length) {
  const arr = [];
  for (let i = 0; i < length; i++) {
    arr.push(i);
  }
  for (let i = 0; i < length; i++) {
    const j = Math.floor(Math.random() * length);
    [arr[i], arr[j]] = [arr[j], arr[i]];
  }
  return arr;
}
